<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<html>

<head>
    <script src="js/jquery/2.0.0/jquery.min.js"></script>
    <link href="css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
    <script src="js/bootstrap/3.3.6/bootstrap.min.js"></script>
    <link href="css/index.css" rel="stylesheet">
</head>

<body>
<%@include file="nav.jsp"%>
<%@include file="header.jsp"%>

<div class="buyPageDiv">
    <form  method="post" action="/submitorder">

        <div class="buyFlow">
            <img class="pull-left" src="img/site/simpleLogo.png">
            <img class="pull-right" src="img/site/buyflow.png">
            <div style="clear:both"></div>
        </div>
        <div class="address">
            <div class="addressTip">输入收货地址</div>
            <div>

                <table class="addressTable">
                    <tr>
                        <td class="firstColumn">详细地址<span class="redStar">*</span></td>

                        <td><textarea name="address" placeholder="建议您如实填写详细收货地址，例如接到名称，门牌好吗，楼层和房间号等信息"
                        >
                            ${orders.address}
                        </textarea></td>
                    </tr>
                    <tr>
                        <td>收货人姓名<span class="redStar">*</span></td>
                        <td><input  name="name"  placeholder="长度不超过25个字符" type="text" value="${orders.name}"></td>
                    </tr>
                    <tr>
                        <td>手机号码 <span class="redStar">*</span></td>
                        <td><input name="tel"  placeholder="请输入11位手机号码" type="text" value="${orders.tel}"></td>
                    </tr>
                </table>

            </div>

        </div>
        <div class="productList">
            <div class="productListTip">确认订单信息</div>

            <table class="productListTable">
                <thead>
                <tr>
                    <th colspan="2" class="productListTableFirstColumn">
                        <img class="tmallbuy" src="img/site/tmallbuy.png">
                        <a class="marketLink" href="#nowhere">店铺：天猫店铺</a>
                        <a class="wangwanglink" href="#nowhere"> <span class="wangwangGif"></span> </a>
                    </th>
                    <th>单价</th>
                    <th>数量</th>
                    <th>小计</th>
                    <th>配送方式</th>
                </tr>
                <tr class="rowborder">
                    <td  colspan="2" ></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
                </thead>
                <tbody class="productListTableTbody">

                <!--
                    varStstus

                    index   0~
                    count   1
                    first       boolean
                    end
                    current

                -->
                <c:forEach items="${ordersItems}" var="oi" varStatus="status">
                <tr class="orderItemTR">
                    <td class="orderItemFirstTD"><img class="orderItemImg" src="${oi.product.pic}"></td>
                    <td class="orderItemProductInfo">
                        <a  href="#nowhere" class="orderItemProductLink">
                                ${oi.product.name}
                        </a>

                        <img src="img/site/creditcard.png" title="支持信用卡支付">
                        <img src="img/site/7day.png" title="消费者保障服务,承诺7天退货">
                        <img src="img/site/promise.png" title="消费者保障服务,承诺如实描述">

                    </td>
                    <td>

                        <span class="orderItemProductPrice">￥${oi.product.price}</span>
                    </td>
                    <td>
                        <span class="orderItemProductNumber">${oi.count}</span>
                    </td>
                    <td><span class="orderItemUnitSum">
						￥${oi.totalPrice}
						</span></td>

                    <c:if test="${status.first}">
                        <td rowspan="${ordersItems.size()}"  class="orderItemLastTD">
                            <label class="orderItemDeliveryLabel">
                                <input type="radio" value="" checked="checked">
                                普通配送
                            </label>

                            <select class="orderItemDeliverySelect" class="form-control">
                                <option>快递 免邮费</option>
                            </select>

                        </td>
                    </c:if>

                </tr>
                </c:forEach>


                </tbody>

            </table>
            <div class="orderItemSumDiv">
<%--                <div class="pull-left">--%>
<%--                    <span class="leaveMessageText">给卖家留言:</span>--%>
<%--                    <span>--%>
<%--					<img class="leaveMessageImg" src="img/site/leaveMessage.png">--%>
<%--				</span>--%>
<%--                    <span class="leaveMessageTextareaSpan">--%>
<%--					<textarea name="userMessage" class="leaveMessageTextarea"></textarea>--%>
<%--					<div>--%>
<%--						<span>还可以输入200个字符</span>--%>
<%--					</div>--%>
<%--				</span>--%>
<%--                </div>--%>

                <span class="pull-right">店铺合计(含运费): ￥12,704.05</span>
            </div>

        </div>

        <div class="orderItemTotalSumDiv">
            <div class="pull-right">
                <span>实付款：</span>
                <span class="orderItemTotalSumSpan">￥${orders.totalPrice}</span>
            </div>
        </div>

        <div class="submitOrderDiv">
            <button type="submit" class="submitOrderButton">提交订单</button>
        </div>
    </form>
</div>

<%@include file="footer.jsp"%>
</body>
</html>